package com.example.ying.repository.neo4j;

import com.example.ying.model.domain.neo4j.Category;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface CategoryRepository extends Neo4jRepository<Category, Long> {
    //获取index电影所属的类型
    @Query("MATCH (n:`电影`)-[r:`属于`]->(m:`类型`) where n.index=$index return m")
    List<Category> findCategoryByMovieIndex(@Param("index") int index);
}
